package com.pleague.common.utils;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
public class ReflectUtil {
	public static List<Class<?>>  getFieldAnnotations(Field field){
		List<Class<?>> list = new ArrayList<Class<?>>();
		Annotation[] annotations = field.getAnnotations();
		if(annotations!=null){
			for(int i =0 ; i < annotations.length;i++){
				list.add(annotations[i].annotationType());
			}
		}
		return list;
	}
	
	public static List<String>  getFieldAnnotationNames(Field field){
		List<String> list = new ArrayList<String>();
		Annotation[] annotations = field.getAnnotations();
		if(annotations!=null){
			for(int i = 0 ; i < annotations.length;i++){
				String name = annotations[i].annotationType().getName();
				list.add(name);
			}
		}
		return list;
	}
}
